<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <div id="app">
        <label for="name">商品名称：</label>
        <input v-on:keyup.enter="name" type="text" id="name">
    </div>

<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    const vm = Vue.createApp({
        methods: {
            name: function() {
                console.log("正在输入商品的名称....")
            }
        }
    }).mount('#app');
</script>

</body>
</html>
